#include "unp.h"

void str_cli(FILE *fp, int fd)
{
    char sendline[MAXLINE], recvline[MAXLINE];

    while (Fgets(sendline, MAXLINE, fp) != NULL) {
        Writen(fd, sendline, strlen(sendline));
        if (Readline(fd, recvline, MAXLINE) == 0) {
            err_sys("str_cli: server terminated prematurely");
        }
        Fputs(recvline, stdout);
    }
}

